<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Title</title>
    <style>
      * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
      }
      #app {
        width: 100%;
      }
      .title {
        font-size: 12px;
        color: sandybrown;
        text-align: center;
        padding: 10px 0;
      }
      .container {
        width: 100%;
        display: flex;
        justify-content: space-around;
        flex-wrap: wrap;
      }
      .container .item {
        width: 200px;
        height: 100px;
        font-size: 14px;
        font-weight: 600;
        color: #666666;
        cursor: pointer;
        /*  阴影的实现*/
        box-shadow: 8px 8px 16px rgba(0, 0, 0, 0.1),
          -8px -8px 16px rgba(255, 255, 255, 1);

        border-radius: 15px;
        transition: all 0.2s;
        margin-bottom: 20px;
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
      }
      .container .item.loading {
        /* 触发的时候，内阴影出现 */
        box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.1),
          0px 0px 0px rgba(255, 255, 255, 1),
          inset 8px 8px 16px rgba(0, 0, 0, 0.1),
          inset -8px -8px 16px rgba(255, 255, 255, 1);
      }
      .container .item:active {
        /* 触发的时候，内阴影出现 */
        box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.1),
          0px 0px 0px rgba(255, 255, 255, 1),
          inset 8px 8px 16px rgba(0, 0, 0, 0.1),
          inset -8px -8px 16px rgba(255, 255, 255, 1);
      }

      .container .item.add {
        background-color: sandybrown;
        color: #ffffff;
      }

      .container > .shadow {
        position: absolute;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        background-color: rgba(0, 0, 0, 0.6);
        z-index: 9;
      }

      .add-new {
        position: absolute;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        background-color: rgba(0, 0, 0, 0.6);
        z-index: 9;
      }

      .add-new-container {
        width: 70%;
        /* height: 400px; */
        background-color: #ffffff;
        border: 2px solid #cccccc;
        z-index: 9;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
      }
      .add-new-container .add-item {
        width: 90%;
        padding: 10px 0;
      }
      .add-new-container .add-item input {
        height: 40px;
        padding: 10px 0;
        text-indent: 10px;
        width: 100%;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <header class="title">{{config.headerInfo}}</header>
      <div class="container">
        <div class="add-new" v-if="isAddNew">
          <div class="add-new-container">
            <div class="title">新增区块</div>
            <div class="add-item">
              <input
                type="text"
                v-model="form.name"
                placeholder="输入区块名称"
              />
            </div>
            <div class="add-item">
              <input type="text" v-model="form.path" placeholder="输入路径" />
            </div>
            <div class="add-item">
              <button @click="isAddNew=false">取消</button>
              <button @click="submitNew">提交</button>
            </div>
          </div>
        </div>
        <div class="shadow" v-show="isShadow">
          <img src="./assets/img/3.gif" alt="" />
        </div>
        <div
          v-for="(item,index) in config.pathList"
          :key="index"
          :title="item.path"
          class="item"
          :class="{loading : currentId===item.id}"
          @dragover.prevent="handleDragOver(item)"
          @dragleave.prevent="handleDragLeave"
          @drop="handleDrop($event,item)"
          @click="handleClick(item)"
        >
          {{item.name}}
        </div>
        <div title="新增路径" class="item add" @click="handleAddClick">+</div>
      </div>
    </div>
    <script src="./assets/js/vue.js"></script>
    <script src="./render/fileGroup.js"></script>
  </body>
</html>
